/* Can be forced with data-theme="light" */
[data-theme="light"],
:root:not([data-theme="dark"]) {
  --muted-color: #4b555c !important;
  --link-color: #27455a !important;
}

/* Automatically enabled if user has Dark mode enabled */
@media only screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --muted-color: #8fa3b1 !important;
    --link-color: #4c82a8 !important;
  }
}

/* Enabled if forced with data-theme="dark" */
[data-theme="dark"] {
  --muted-color: #8fa3b1 !important;
  --link-color: #4c82a8 !important;
}

:root {
  --spacing-hero: 5rem;
  --border-radius: 0.3rem !important;
}

*,
::after,
::before {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

.hero {
  background-color: #394046;
  background-position: center;
  background-size: cover;
  h1,
  a[role='button'].outline.contrast {
    color: #edf0f3;
    border-color: #edf0f3;
  }
  .hero-buttons {
    margin: 10px 10px 10px 0;
    color: var(--mark-color);
  }
}
header {
  padding: var(--spacing-hero) 0;
}

.logo {
  width: fit-content;
  display: flex;
  align-items: center;
}

@media (min-width: 0px) and (max-width: 1200px) {
  main {
    margin-top: 50px;
  }
}

img {
  object-fit: cover;
}

.text-center {
  text-align: center;
}

.button,
kbd {
  margin: 10px;
}
img,
.button {
  border-radius: var(--border-radius);
}

a {
  text-decoration: none !important;
  color: var(--link-color);
}

.grid {
  article {
    padding: calc(var(--spacing) * 1.2) var(--block-spacing-horizontal);
    margin: 1rem 0;
  }
}

@media (min-width: 992px) {
  .grid-post {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (min-width: 992px) {
  .grid-main {
    grid-template-columns: 2fr 1fr !important;
  }
}

.toc {
  padding: 2rem 1.2rem 1rem 1.2rem;
}

.share-buttons {
  background: var(--card-background-color);
  padding: 10px;
  border-radius: var(--border-radius);
  box-shadow: var(--card-box-shadow);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  svg {
    color: var(--contrast) !important;
    width: 1.875rem;
    height: 1.875rem;
  }
}

.searchbox,
.contact-form {
  max-width: 700px;
  margin: auto;
}

.search-result {
  background: var(--card-background-color);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--card-box-shadow);
  margin: 10px 0;
  hgroup {
    margin: 0;
  }
  h6 {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.cover {
  float: left;
  margin: 0 20px 0 0;
  width: 300px;
  max-width: 100%;
  pointer-events: none;
}
@media (min-width: 0px) and (max-width: 576px) {
  .cover {
    float: none;
    margin: 10px auto;
  }
}

.post {
  &::first-letter {
    font-size: 300%;
    padding: 0px 5px 0px 0px;
    margin: -15px 6px -15px 0;
    float: left;
  }
}

.highlight,
code,
pre {
  position: relative !important;
}

.copy-code {
  z-index: 99;
  cursor: pointer;
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(78, 78, 78, 0.8);
  border-radius: var(--border-radius);
  padding: 0 5px;
  font-size: 14px;
  user-select: none;
}

.highlight:hover,
code:hover,
pre:hover {
  .copy-code {
    display: block;
  }
}

.page-item.active {
  font-size: larger;
  font-weight: bold;
}

.archive-posts {
  width: 100%;
  font-size: 16px;
}

.archive-year {
  margin-top: 40px;
}

.archive-year:not(:last-of-type) {
  border-bottom: 2px solid var(--border);
}

.archive-year-header {
  text-align: center;
}

.archive-month {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
}

.archive-month-header {
  margin: 25px 0 25px auto;
  width: 200px;
}

.archive-month:not(:last-of-type) {
  border-bottom: 1px solid var(--border);
}

.archive-entry {
  position: relative;
  padding: 5px;
  margin: 10px 0;
}

.archive-entry-title {
  margin: 5px 0;
  font-weight: 400;
}

.archive-count,
.archive-meta {
  color: var(--secondary);
  font-size: 14px;
}

.entry-link {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

.anchor,
.hidden {
  display: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  &:hover {
    .anchor {
      cursor: pointer;
      display: inline-flex;
      margin-inline-start: 8px;
      font-weight: 500;
      user-select: none;
    }
  }
}

.min-h-80 {
  min-height: 80vh;
}

kbd,
.grid-post article,
a[role='button'],
.search-result,
.portfolio-post {
  transition: 0.3s ease;
  &:hover {
    animation: hover 0.3s ease;
    transform: scale3d(1.05, 1.05, 1.05);
  }
}

#cookie-banner {
  position: fixed;
  top: 0;
  z-index: 100;
  top: 3%;
  right: 3%;
  max-width: 400px;
  opacity: 0.9;
}

@keyframes hover {
  0% {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.08, 1.08, 1.08);
  }
  100% {
    transform: scale3d(1.05, 1.05, 1.05);
  }
}
